From 03285c1a358072af31d6365b31675f64248a81e6 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 11 May 2012 15:52:52 +0100 Subject: [PATCH] libxl: default to xenconsoled for pv guests Default to xenconsoled for pv guests, even if qemu is running. Currently we prefer to use qemu for the disk backend if we are starting qemu anyway (e.g. to service a disk). Unfortunately qemu doesn't log the console, which xenconsoled can do via XENCONSOLED_TRACE=guest. Since xenconsoled is also running anyway it seems like there is no particular reason to prefer qemu just because it happens to be running. However we must use qemu if thereis more than one console (xenconsoled only supports a single console). Therefore push the logic to change the console backend down into libxl__need_xenpv_qemu so that it can do the right thing. Signed-off-by: Ian Campbell Acked-by: Stefano Stabellini Committed-by: Ian Jackson --- tools/libxl/libxl_create.c | 3 --- tools/libxl/libxl_dm.c | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 7ab2f72200..6df20ca689 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -682,9 +682,6 @@ static int do_domain_create(libxl__gc *gc, libxl_domain_config *d_config, d_config->num_vfbs, d_config->vfbs, d_config->num_disks, &d_config->disks[0]); - if (need_qemu) - console.consback = LIBXL__CONSOLE_BACKEND_IOEMU; - libxl__device_console_add(gc, domid, &console, &state); libxl__device_console_dispose(&console); diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index ec967f784a..36b07307c6 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -1095,7 +1095,13 @@ int libxl__need_xenpv_qemu(libxl__gc *gc, { int i, ret = 0; + /* + * qemu is required in order to support 2 or more consoles. So switch all + * backends to qemu if this is the case + */ if (nr_consoles > 1) { + for (i = 0; i < nr_consoles; i++) + consoles[i].consback = LIBXL__CONSOLE_BACKEND_IOEMU; ret = 1; goto out; } -- 2.30.2